Write on the margins of the internet. Powered by the AT Protocol. margin.at
extension web atproto comments
at main 30 lines 712 B view raw
1--- 2export const prerender = false; 3 4import OGLayout from '../../../layouts/OGLayout.astro'; 5import { resolveHandle, fetchOGForRoute } from '../../../lib/og'; 6 7const { handle, rkey } = Astro.params; 8 9let title = 'Margin'; 10let description = 'Annotate the web'; 11let image = 'https://margin.at/og.png'; 12 13if (handle && rkey) { 14 try { 15 const did = await resolveHandle(handle); 16 if (did) { 17 const data = await fetchOGForRoute(did, rkey, 'at.margin.annotation'); 18 if (data) { 19 title = data.title; 20 description = data.description; 21 image = data.image; 22 } 23 } 24 } catch (e) { 25 console.error('OG fetch error (annotation):', e); 26 } 27} 28--- 29 30<OGLayout title={title} description={description} image={image} />